package com.piggy.provider;

import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.util.concurrent.CountDownLatch;

public class GenericCallProvider {

    public static void main(String[] args) throws Exception {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring/generic-provider.xml");
        context.start();
        System.out.println("dubbo service started");

        CountDownLatch countDownLatch = new CountDownLatch(1);
        Runtime.getRuntime().addShutdownHook(new Thread(() -> {
            countDownLatch.countDown();
            System.out.println("dubbo service stopped");
        }));
        countDownLatch.await();
    }

}
